<template>
	<view :class="['actionsheet', visible ? 'active' : '']">
		<view class="actionsheet-content">
			<slot name="actionsheet-child"></slot>
			<view class="actionsheet-cancel" @click="cancelAction">
				<text>取消</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: [
			'visible'
		],
		data() {
			return {
				
			}
		},
		methods: {
			cancelAction() {
				this.$emit('cancel');
			}
		}
	}
</script>

<style lang="scss">
	.actionsheet {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		right: 0;
		width: 100%;
		height: 100%;
		background-color: rgba(0, 0, 0, .6);
		z-index: 99;
		display: none;
		align-items: flex-end;
		&.active {
			display: flex;
		}
		.actionsheet-content {
			padding: 0 20rpx 20rpx;
			width: 100%;
			box-sizing: border-box;
		}
		.actionsheet-cancel {
			background-color: #fff;
			border-radius: 10rpx;
			height: 100rpx;
			line-height: 100rpx;
			text-align: center;
			margin-top: 30rpx;
			text {
				font-size: 32rpx;
				color: #333;
			}
		}
	}
</style>
